package org.chinacloud.wanghui.jdownload;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.lang.reflect.InvocationTargetException;

/**
 * Created with IntelliJ IDEA.
 * User: wanghui
 * Date: 13-10-31
 * Time: 下午2:39
 * To change this template use File | Settings | File Templates.
 */
public interface Downloader {
    public boolean isDownloading();
    public boolean isCompleted();
    public String getSavePathString();
    public long getSize();
    public long getProgress();
    public void deleteSateFile();
    public void saveState() throws IOException;
    public void loadState(ObjectInputStream inputStream) throws
                   FileNotFoundException,IOException,ClassNotFoundException,
                   InstantiationException,IllegalAccessException,IllegalArgumentException,
                   InvocationTargetException,NoSuchMethodException,SecurityException;

    public boolean start() throws IOException;
    public boolean start(int connectionCount) throws IOException;
    public void stop();
    public void pause();
    public boolean resume() throws IOException;
    public boolean isSupportRange();
    public String getProtocal();
}
